<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class Activity extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */


    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
           'title' => 'required',
            'route' => 'required',
            'type' => 'required',
            'collection_time' => 'required',
            'collection_place' => 'required',
           'limit_of_number' => 'integer'
        ];
    }
  public function messages(){
        return [
            'title.required' => '必须填写标题',
            'route.required' => '必须填写路线',
            'type.required' => '必须填写活动类型',
            'collection_time.required' => '必须填写集合时间',
            'collection_place.required' => '必须填写集合地点',
            'limit_of_number.integer' => '限制人数请填写数字'
        ];
    }
}
